package com.bawei.exam57.fragment.jf

import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.bawei.exam57.R
import com.bawei.exam57.adpater.JfAdpater
import com.bawei.exam57.base.BaseViewFragment
import com.bawei.exam57.databinding.FragmentIntoBinding
import com.bawei.exam57.room.RoomUtils
import java.util.Collections

class IntoFragment : BaseViewFragment<FragmentIntoBinding>() {
    override fun initView() {
        val jfAdpater= JfAdpater()
        val all = RoomUtils.getJFDb().jfDao().outin(true)
        Collections.reverse(all)
        jfAdpater.data.clear()
        jfAdpater.data.addAll(all)
        jfAdpater.notifyDataSetChanged()
        binding.inRv.adapter=jfAdpater
    }

    override fun initData() {

    }

    override fun getLayoutId(): Int {
        return R.layout.fragment_into
    }

    override fun onResume() {
        super.onResume()
        val jfAdpater= JfAdpater()
        val all = RoomUtils.getJFDb().jfDao().outin(true)
        Collections.reverse(all)
        jfAdpater.data.clear()
        jfAdpater.data.addAll(all)
        jfAdpater.notifyDataSetChanged()
        binding.inRv.adapter=jfAdpater
    }

}